home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / infosrvr / dev / www_talk.930 / 000014_emv@heifetz.msen.com _Wed Nov 20 10:30:27 1991.msg < prev    next >
Internet Message Format  |  1994-01-24  |  2KB

  1. Return-Path: <emv@heifetz.msen.com>
  2. Received: from cernvax.cern.ch by  nxoc01.cern.ch  (NeXT-1.0 (From Sendmail 5.52)/NeXT-2.0)
  3.     id AA08265; Wed, 20 Nov 91 10:30:27 GMT+0100
  4. Received: by cernvax.cern.ch (5.57/Ultrix2.0-B)
  5.     id AA11177; Wed, 20 Nov 91 10:26:56 +0100
  6. Received: by dxmint.cern.ch (cernvax) (5.57/3.14)
  7.     id AA01645; Wed, 20 Nov 91 10:21:09 +0100
  8. Received: by heifetz.msen.com (/\==/\ Smail3.1.22.1 #22.11)
  9.     id <m0kjoAF-000HftC@heifetz.msen.com>; Wed, 20 Nov 91 04:24 EST
  10. Message-Id: <m0kjoAF-000HftC@heifetz.msen.com>
  11. To: www-talk@nxoc01.cern.ch
  12. Cc: archie-maint@cc.mcgill.ca, prospero@isi.edu
  13. Subject: prototype of www-prospero-archie interface
  14. Date: Wed, 20 Nov 91 04:24:09 -0500
  15. From: Edward Vielmetti <emv@msen.com>
  16.  
  17. What I say prototype, I mean just a little teeny tiny idea
  18. turned into a few lines of code.
  19.  
  20. This is a piece of perl that is a gateway between archie and
  21. WWW.  It should be set up to run as a server under inetd.  It
  22. takes incoming requests of the form
  23.     GET /nic.funet.fi/exact?wais
  24. and returns HTML formatted archie results back.  It depends on the
  25. C language Prospero archie client that you can get from (e.g.)
  26. ftp.cs.widener.edu.
  27.  
  28. My HTML is really bad but you get the idea, it should look somehow
  29. somewhat reasonable and something you can click on.
  30.  
  31. With a little bit of work any dbm file looks like it can be turned
  32. into a WWW queryable server along the same lines.
  33.  
  34. Take note that you are inviting truly perverse packet transport,
  35. with a query from one site resutling in hundreds of packets being
  36. shuttled all around the world ....
  37.  
  38. --Ed
  39.  
  40. #!/usr/local/bin/perl
  41.  
  42. # gateway from www to archie
  43. # this is the "brute force" kind of approach; a tidier solution
  44. # would speak the prospero protocols directly.
  45.  
  46. while (<>) {
  47.     if (m,^GET /(.*)/(.*)\?(.*)$,) {
  48.         $archie = $1;
  49.         $type = $2;
  50.         $query = $3;
  51.     } else {
  52.         exit 0; # XXX 
  53.     }
  54. #    print "$node $database $query \n";
  55.     if ($type eq 'exact') {
  56.         $arg = " -e ";
  57.     } else {
  58.         $arg = " -s ";
  59.     }
  60.     $archcmd = "archie -l -t " . $arg . " -h " . $archie . " " . $query ;
  61.     print "<title>archie $type search for $query on $archie </title>\n";
  62.     @result = `$archcmd`;
  63.     foreach (@result) {
  64.         ($time, $size, $host, $file) = split;
  65.         print "<a href=file://anonymous@$host:$file>\n";
  66.         print "$_</a>\n";
  67.     }
  68. }
  69.